package com.imooc.bilibili.domain;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;
import java.util.List;

/**
 * 视频记录表
 */
@Document(indexName = "videos")
public class Video {

    /**
     * 主键id
     */
    @Id // 标识注解id
    private Long id;

    /**
     * 用户id
     * 该视频是哪个用户投稿的
     */
    @Field(type = FieldType.Long) // 告诉es，userId是通过long类型进行存储的
    private Long userId;

    /**
     * 视频链接
     */
    private String url;

    /**
     * 封面
     */
    private String thumbnail;

    /**
     * 标题
     */
    @Field(type = FieldType.Text) // 告诉es，这个title是可以进行分词处理的
    private String title;

    /**
     * 视频类型：0自制，1转载
     */
    private String type;

    /**
     * 视频时长
     */
    private String duration;

    /**
     * 所在分区：0鬼畜，1音乐，2电影
     */
    private String area;

    /**
     * 标签列表，存放视频关联的标签
     */
    private List<VideoTag> videoTagList;

    /**
     * 视频简介
     */
    @Field(type = FieldType.Text) // 告诉es，这个description是可以进行分词处理的
    private String description;

    /**
     * 创建时间
     */
    @Field(type = FieldType.Date) // 告诉es，createTime是通过Date类型进行存储的
    private Date createTime;

    /**
     * 更新时间
     */
    @Field(type = FieldType.Date) // 告诉es，updateTime是通过Date类型进行存储的
    private Date updateTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getThumbnail() {
        return thumbnail;
    }

    public void setThumbnail(String thumbnail) {
        this.thumbnail = thumbnail;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDuration() {
        return duration;
    }

    public void setDuration(String duration) {
        this.duration = duration;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public List<VideoTag> getVideoTagList() {
        return videoTagList;
    }

    public void setVideoTagList(List<VideoTag> videoTagList) {
        this.videoTagList = videoTagList;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
